package com.zephyr.vchcenter.service.impl;

import java.net.MalformedURLException;
import java.net.URL;

import org.codehaus.xfire.client.Client;

import com.zephyr.vchcenter.service.IStampService;
import com.zephyr.vchcenter.util.ProperitesHelper;

public class StampServiceImpl implements IStampService {


	public String getStamp(int commandid, String xml) {

		Client client = null;
		try {
			client = new Client(new URL(ProperitesHelper.getStampServerUrl()));
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		Object[] argvs = null;
		argvs = new Object[] { commandid, xml };
		String uRet = null;
		try {
			uRet = client.invoke("zms", argvs)[0].toString();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return uRet;
	}

}
